FROM maven:3.6.3-openjdk-11 AS builder
WORKDIR /app
ADD pom.xml ./
ADD src ./src
ADD mvnsetting.xml ./mvnsetting.xml
ADD .mvn ./.mvn
RUN mvn install -Dmaven.test.skip=true -s ./mvnsetting.xml

FROM openjdk:11-jre-slim
COPY --from=builder /app/target/javatoolopts-0.0.1.jar app.jar
RUN touch /app.jar
EXPOSE 80
ENTRYPOINT ["java","-jar","/app.jar"]
